#ifndef QUICKBUTTONS_H
#define QUICKBUTTONS_H

#include <Windows.h>
#include <WindowsX.h>
#include <map>

#include "CustomWindow.h"
#include "CassiopeiaComponent.h"
#include "Translation.h"
#include "Settings.h"
#include "PaintedButton.h"
#include "resource.h"
#include "SmoothWindowSideAnimation.h"

using namespace std;
using namespace Translation;

class QuickButtons : public CassiopeiaComponent, public CustomWindow
{
public:
	QuickButtons();
	~QuickButtons();
	void Create(HINSTANCE hInstance);
	CCState Activate();
	CCState Deactivate();

private:
	void Open(bool value);
	void ToggleOpen();
	bool HandleQuickButtonWndProcs(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
	void HandleQuickButtonsPainting(HDC hdc);
	HRESULT ShowOpenFileDialog(HWND hwnd, LPTSTR * fileName);
	HRESULT ShowOpenFolderDialog(HWND hwnd, LPTSTR * folderName);
	void LoadSettings();
	void SaveSettings();
	void ChangeDwmCompatibleLayout();

	bool opened;
	bool hotkeyOpened;

	int normalWidth;
	int openedWidth;
	POINT location;

	PaintedButton* buttonOpen;
	SmoothWindowSideAnimation *animation;
	map<int, PaintedButton*> quickButtons;
	map<int, int> quickButtonFunctions;
	map<int, tstring> quickButtonType1Commands;


	static void buttonOpen_Clicked(PaintedButton* sender, LPVOID tag);
	static void quickButton_Clicked(PaintedButton* sender, LPVOID tag);
	static void quickButton_RightMouseButtonUp(PaintedButton* sender, LPVOID tag);
	static LRESULT CALLBACK WndProc(LPVOID sender, HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
};

#endif